package com.shop.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.shop.po.Shopcart;

public interface ShopcartMapper {

	//通过uid查询购物车列表
	List<Shopcart> selCartByUid(int uid);
	
	//通过uid和pid查询商品是否在购物车里
	Shopcart selCartByUidAndPid(@Param("uid") int uid,@Param("pid") int pid);
	
	Shopcart selCartById(int id);
	
	int updateCount(@Param("count") int count,@Param("id") int id,@Param("subtotle") double subtotle);
	
	//添加购物车信息 
	int insertCart(Shopcart shopcart);
	
	//删除单个购物车商品
	int deleteByPrimaryKey(int id);
	
	//清空购物车 
	int deleteByUid(int uid);
}
